/***************************************************************************
 *   Copyright (C) 2008 by JBox systems
 *   gabi@shaargiora.co.il
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 ***************************************************************************/

#pragma once

#include <vector>
#include "model.h"
#include "version.h"

/**
	Model for representing available applications.
*/
class AppsModel : public Model {
	Q_OBJECT

	public:

		/**
			Constructor for AppsModel.
			@param data Vector of application to display.
			@param parent Parent for Qt heirarchy and memory management.
		*/
		AppsModel(const std::vector<Application> data, QObject *parent = 0);

		/**
			Get all versions that are "checked".
			@return vector of selected versions
		*/
		std::vector<Version> getSelected();

		std::vector<Version> getLastVersions();

		/**
			Sets the provided versions as "checked".
			@param vers versions to select.
		*/
		std::vector<QModelIndex> setSelected(std::vector<Version> vers);
		/**
			Wipes and repopulates model.
			@param data Vector of applications to display.
		*/
};
